package com.xnyzc.lhy.common.penum.coupon;

import com.xnyzc.lhy.common.entity.PEnum;

/**
 * 优惠券信息
 *
 * @Author: haoyfa
 * @Date: 2019-12-17
 */
public enum CouponErrorCode implements PEnum<Integer> {
    //成功标志
    success(0, "success"),
    unKnow(403, "未知错误"),
    failureOfVerification(10001, "验签失败"),
    userTookenVerification(10002, "用户token错误"),
    paramEmptyError(10003, "参数不能为空"),
    paramError(10004, "参数错误"),
    noCoupon(20001, "优惠券已经发放完毕"),
    misServerError(14004, "mis服务无法访问"),
    didiServerError(14005, "滴滴方绑定优惠券出错");

    int value;
    String desc;

    CouponErrorCode(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String toString() {
        return name();
    }

    @Override
    public String toChString() {
        return desc;
    }

    public String toMessage() {
        String errorMessage = this.value + "," + this.desc;
        return errorMessage;
    }
}
